package com.lifa.service.impl;

import com.lifa.dao.TaocanPeizhiDao;
import com.lifa.entity.Chanpin;
import com.lifa.entity.Taocan;
import com.lifa.service.TaocanPeizhiService;
import com.lifa.service.TaocanService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class TaocanPeizhiServiceImpl implements TaocanPeizhiService {
    @Autowired
    private TaocanPeizhiDao taocanPeizhiDao;
    @Autowired
    private TaocanPeizhiService taocanPeizhiService;

    /**
     * 查询全部
     * @return
     */
    public List<Taocan> list() {
        return taocanPeizhiDao.query();
    }

    @Override
    public List<Taocan> findAll(String name, int offset, int limit) {
        return taocanPeizhiDao.queryPage(name,offset,limit);
    }

    @Override
    public int findTotalCount(String name) {
        return taocanPeizhiDao.getTotalCount(name);
    }

    /**
     * 根据商品id查询
     * @param shangpin_Id
     * @return
     */
    @Override
    public List<Taocan> queryId(int shangpin_Id) {
        return taocanPeizhiService.queryId(shangpin_Id);
    }
}
